package com.example.myapplication.markwon

import io.noties.markwon.MarkwonConfiguration
import io.noties.markwon.RenderProps
import io.noties.markwon.SpanFactory
import io.noties.markwon.core.CoreProps

/**
 * Create by Tanzhenxing on 2025/7/14.
 * Description:
 */
class LinkSpanFactory : SpanFactory {
    override fun getSpans(
        configuration: MarkwonConfiguration,
        props: RenderProps
    ): Any? {
        return LinkSpan(theme = configuration.theme(),
            linkString = CoreProps.LINK_DESTINATION.require(props),
            configuration.linkResolver(),
        )
    }
}